<template>
    <div class="clock">
        <div class="clock-face">
            <!-- 绘制时针和分针 -->
            <div class="hand hour-hand"></div>
            <div class="hand min-hand"></div>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'clock2',
        data() {
            return {
                currentTime: new Date()
            };
        },
        mounted() {
            // 每秒更新时间
            setInterval(this.updateTime, 1000);
        },
        methods: {
            updateTime() {
                this.currentTime = new Date();
            }
        }
    };
</script>

<style scoped>
    .clock {
        width: 300px;
        height: 300px;
        position: relative;
        border: 4px solid #333;
        border-radius: 50%;
        margin: 50px auto;
    }

    .clock-face {
        width: 100%;
        height: 100%;
        position: relative;
    }

    .hand {
        width: 50%;
        height: 10px;
        position: absolute;
        top: 50%;
        transform-origin: 50% -60px;
        transition: transform 0.05s;
    }

    .hour-hand {
        border: 4px solid #333;
        border-radius: 6px;
        transform: rotate(0deg);
    }

    .min-hand {
        width: 30%;
        border: 2px solid #333;
        border-radius: 5px;
        transform: rotate(0deg);
    }
</style>
